package com.huike.business.service.impl;


import com.huike.business.domain.TbBusiness;
import com.huike.business.domain.TbBusinessTrackRecord;
import com.huike.business.mapper.TbBusinessMapper;
import com.huike.business.mapper.TbBusinessTrackRecordMapper;
import com.huike.business.service.ITbBusinessTrackRecordService;
import com.huike.clues.mapper.SysDictDataMapper;
import com.huike.common.utils.DateUtils;
import com.huike.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 商机跟进记录Service业务层处理
 * 
 * @author wgl
 * @date 2021-04-28
 */
@Service
public class TbBusinessTrackRecordServiceImpl implements ITbBusinessTrackRecordService {
    //商机显示列表
    @Autowired
    private TbBusinessTrackRecordMapper tbBusinessTrackRecordMapper;
    @Autowired
    private SysDictDataMapper sysDictDataMapper;

//    @Override
//    public TbBusinessTrackRecord list(Long id) {
//        return tbBusinessTrackRecordMapper.selectTbBusinessTrackRecordById(id);
//    }

    @Override
    public List<TbBusinessTrackRecord> selectTbBusinessTrackRecordList(Long id) {
        return tbBusinessTrackRecordMapper.selectTbBusinessTrackRecordById(id);
    }


//    @Override
//    public TbBusinessTrackRecord list(Long id) {
//        //new
//       TbBusinessTrackRecord tbBTR=tbBusinessTrackRecordMapper.selecTbBusinessTrackRecordById(id);
//        List<String> keys = new ArrayList<>();
//        String keyItems = tbBTR.getKeyItems();
//        if(keyItems !=null && keyItems!=""){
//            String[] split = keyItems.split(",");
//            for (String s : split) {
//                keys.add(sysDictDataMapper.selectDictLabel("communication_point", s));
//            }
//            tbBTR.setKeys(keys);
//        }
//        tbBTR.setUpdateTime(null);
//        tbBTR.setUpdateBy(null);
//        String username = SecurityUtils.getUsername();
//        tbBTR.setCreateBy(username);
//        tbBTR.setCreateTime(DateUtils.getNowDate());
//        return tbBTR;
//    }
}
